<?php 
session_start();
date_default_timezone_set('America/Los_Angeles'); 
$user = $_SESSION['password'];
if (!$user) { header('location: login.php'); exit; }

if (!$_GET['new_date']) {
	$date = date("Y-m-d\TH:i:s"); echo "<!--".$date."-->";
}else{
	
	if ($_GET['new_date'] > date('Y-m-d')) DIE ("<html><script language='JavaScript'>alert('Please pick a date in the past. To view or edit playlist in the future, use the Future Playlists button.'),history.go(-1)</script></html>"); 
	
	$date = $_GET['new_date']."T12:00:00";
	//echo $date;
}


 ?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Playlists</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style type="text/css" media="screen">
body {
		background-image: url("../images/concrete_bg.jpg");
		background-repeat: repeat;
		height: 100%;
	}
</style>
<script type="text/javascript">   

$(document).ready(function() {
	refreshList();
});

function refreshList() {
	 
	$("#list").load("_playlists.php?date=<?=$date?>");
	$("#wall").load("_wall.php?date=<?=$date?>"); 
	
	setTimeout("refreshList();",10000);
}

function validate()  {
	if (document.form1.show_id.value == 0) {
	alert ("Please select a show to create a playlist for");
	return false;
	} else {  return true; }
 
}  


function validateDel(playlist_id)  {
  var url = "playlists.php?del="+ playlist_id;
  var answer = confirm("Are you sure you want to delete this playlist?")
		if (answer){
			window.location = url;
		}
		else{

		}
 
}
</script>   
</head>

<body bgcolor="#eeeeee">

  
<a href='index.php' style='color:white;'>«Main Menu</a><br>
<div></div>
<div id='list'></div>
<div id='wall_bg' class='wall'></div>

<div class='wall' id='wall'></div>
<div id='marker'><a href='_wall_form.php' title='Write on the Wall!'><img src='../images/marker-pen.png' border='0'></a></div>

</body>
</html>
